import toast, { toastEventBus } from './toast';
import alert from './alert';
import confirmDialog, { confirm } from './confirm';
import tooltip from './tooltip';
import modal from './modal';
import loading from './loading';
import { UI, initAdnaanUI, cleanupAdnaanUI } from './global';

// 导出类型
export type * from './common-types';
export type { ModalOptions, ModalSize } from './modal';
export type { LoadingOptions, LoadingInstance } from './loading';

// 导出所有UI工具函数
export const ui = {
  toast,
  alert,
  confirm,
  confirmDialog,
  tooltip,
  modal,
  loading,

  // 全局初始化和清理方法
  init: initAdnaanUI,
  cleanup: cleanupAdnaanUI,
};

// 单独导出便于直接使用
export { toast, toastEventBus, alert, confirm, confirmDialog, tooltip, modal, loading };

// 导出全局UI对象
export { UI, initAdnaanUI, cleanupAdnaanUI };

// 默认导出 - 包含所有功能
export default {
  ...UI,
  ui,
  // 便捷方法
  install: initAdnaanUI, // 类似Vue插件的install方法
};
